package domain

import (
	"context"
	"kafkademo/adapter/repository"
	"kafkademo/internal/dependency"
	"kafkademo/internal/entity"
)

func NewMessageDomain() *MessageDomain {
	return &MessageDomain{
		Repo: repository.NewMqMessageRepository(),
	}
}

type MessageDomain struct {
	Repo dependency.IMqMessageRepository
}

func (d *MessageDomain) Save(ctx context.Context, es ...*entity.MqMessage) (int64, error) {
	return d.Repo.BaseSave(ctx, es)
}
